<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="../css/aui.2.0.css">
    <link rel="stylesheet" href="../css/homeCommon.css">
    <link rel="stylesheet" href="../css/homePage.css">
    <link rel="stylesheet" href="../css/alert.css">
    <link rel="stylesheet" href="../css/discountMall.css">
</head>
<body>
<!--搜索框-->
<header>
    <div class="aui-searchbar" id="search">
        <div class="aui-searchbar-input aui-border-radius">
            <form class="search-form">
                <i class="aui-iconfont aui-icon-search"></i>
                <input type="search" placeholder="请输入搜索内容" id="search-input" autocomplete="off">
                <div class="aui-searchbar-clear-btn" id="clean-search">
                    <i class="aui-iconfont aui-icon-close"></i>
                </div>
            </form>
        </div>
        <div class="aui-searchbar-btn aui-text-info" tapmode>搜索</div>
    </div>
</header>
<nav style="margin-top:2rem;">
    <div id="dis-list-vessel"></div>
    <div class="loading">加载更多...</div>
    <div class="no-info">没有更多信息了...</div>
    <div class="footer-height"></div>
    <div class="all-mask"></div>

    <!--立即分享-->
    <section class="wxmass-sends">
        <section class="wxmass-sends-item">
            <div class="wxmass-item-title">
                <span class="cancel">取消</span>
                <span>分享</span>

            </div>
            <!--<div class="wxmass-item-img">
                <img src="../images/banner1.png" alt="">
            </div>-->
            <ul class="wxmass-item-list">
                <li class="share-firends">
                    <div class="wxmass-item-list-img">
                        <img src="../images/sends1.png" alt="">
                    </div>
                    <span>发送给朋友</span>
                    <div class="aui-col-xs-3 wxmass-col-xs-3">
                        <i class="aui-iconfont aui-icon-right"></i>
                    </div>
                </li>
                <li class="share-firends-quan">
                    <div class="wxmass-item-list-img">
                        <img src="../images/sends2.png" alt="">
                    </div>
                    <span>分享到朋友圈</span>
                    <div class="aui-col-xs-3 wxmass-col-xs-3">
                        <i class="aui-iconfont aui-icon-right"></i>
                    </div>
                </li>
                <!--<li class="share-QQ">
                    <div class="wxmass-item-list-img">
                        <img src="../images/sends2.png" alt="">
                    </div>
                    <span>分享到QQ</span>
                    <div class="aui-col-xs-3 wxmass-col-xs-3">
                        <i class="aui-iconfont aui-icon-right"></i>
                    </div>
                </li>
                <li class="share-weibo">
                    <div class="wxmass-item-list-img">
                        <img src="../images/sends2.png" alt="">
                    </div>
                    <span>分享到微博</span>
                    <div class="aui-col-xs-3 wxmass-col-xs-3">
                        <i class="aui-iconfont aui-icon-right"></i>
                    </div>
                </li>-->
            </ul>
        </section>
    </section>
</nav>

<footer class="aui-bar aui-bar-tab" id="footer" style="display:none;">
    <a href="javascript:;">
        <div class="aui-bar-tab-item my-aui-active" tapmode>
            <img class="footer-icon-img" src="../images/JD_click.png" alt="">
            <div class="aui-bar-tab-label">首页</div>
        </div>
    </a>
    <a href="extension.html">
        <div class="aui-bar-tab-item" tapmode>
            <i class="aui-iconfont aui-icon-calendar"></i>
            <div class="aui-bar-tab-label">分享中心</div>
        </div>
    </a>
    <a href="commodity.html">
        <div class="aui-bar-tab-item" tapmode>
            <i class="aui-iconfont aui-icon-cert"></i>
            <div class="aui-bar-tab-label">商品中心</div>
        </div>
    </a>
    <a href="my.html">
        <div class="aui-bar-tab-item" tapmode>
            <i class="aui-iconfont aui-icon-my"></i>
            <div class="aui-bar-tab-label">我</div>
        </div>
    </a>
</footer><script type="text/x-handlebars-template" id="discount-list-template">
    {{#each list}}
    <a href="javascript:;" class="display-box">
        <div class="dis-list-box" data-id="{{id}}" data-sku="{{sku}}" data-couponurl="{{conUrlB}}">
            <div class="dis-shop-img">
                <!--<img src="../img/grey.gif" data-src="{{mainImageUrl}}" alt="">-->
                <img src="../images/lazy.gif" data-src="{{goodsUrl}}" alt="">
            </div>
            <div class="dis-list-content">
                <div class="dis-shop-detail">
                    
                    <span class="shop-list-name">{{goodsName}}</span>
                </div>
                <!--<div class="dis-price">
                    <span>￥{{conPrice}}</span>
                    <span>￥{{oriPrice}}</span>
                </div>-->
                <div class="dis-evaluate">
                    <span>赚:{{commissionProfit}}元</span>
                    <!--<span>佣金率 <span>{{splitNumber commission}}%</span></span>-->
                    <span>京东价:￥{{oriPrice}}</span>
                </div>
                <div class="dis-sale">
                    <span class="hongbao youhuiquan">红包券 <span>{{conTicketPrice}}</span>元</span>
                    <span class="dis-share" data-id="{{id}}" >分享</span>
                </div>
            </div>
        </div>
    </a>
    {{/each}}
</script>

<script>
    /**
     * 判断是iOS或是安卓，改变数据的获取方式
     *
     * */

    var ua = navigator.userAgent.toLowerCase();  //判断浏览器类型
    if (/iphone|ipad|ipod/.test(ua)) {
        //alert('iOS的弹窗');
        var data = {
            postType: 'getToken'
        };
        postSuccessToken(data);

    } else {
        //alert('android的弹窗。');
        postAndroidToken();
    }


    //调用ios获取token方法。
    function postSuccessToken(data) {
        window.webkit.messageHandlers.postSuccessToken.postMessage(data);
    }

    //调用Android获取token方法
    function postAndroidToken() {
        window.huifa.getToken();
    }


    function getToken(token) {
        localStorage.setItem('token', token);
        //alert('获取到的token为'+token);
    }

</script>
<script src="../js/jquery-3.0.0.min.js"></script>
<script src="../js/handlebars-v4.0.10.js"></script>
<script src="../js/config.js"></script>
<script src="../js/api.2.0.js"></script>
<script src="../js/search.js"></script>
<script src="../js/function.js"></script>
<script src="../js/common.js"></script>
<script src="../js/alert.js"></script>
<script src="../js/aui-lazyload.js"></script>
<script src="../js/aui-slide.js"></script>
<script src="../js/jd_index.js"></script>
</body>
</html>